﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace _01_Prism_No
{
    public class Command : ICommand
    {
        private Action<string> execute;

        public event EventHandler? CanExecuteChanged;

        public Command(Action<string> action)
        {
            execute = action;
        }

        public bool CanExecute(object? parameter)
        {
            return true;
        }

        public void Execute(object? parameter)
        {
            execute?.Invoke(parameter as string);
        }
    }
}
